package com.avic.rong.listener;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.avic.rong.activity.ArticleDetailActivity;
import com.avic.rong.utils.DateUtils;

import java.lang.ref.WeakReference;

/**
 * Creater: Created by wangyz on 2017/3/27.
 * Email: 936804097@qq.com
 */

public class RecommendItemOnClickListener implements View.OnClickListener {

    private WeakReference<Context> contextWeakReference;
    private int categoryId;

    public RecommendItemOnClickListener(Context context, int categoryId) {
        this.contextWeakReference = new WeakReference<>(context);
        this.categoryId = categoryId;
    }

    @Override
    public void onClick(View view) {
        if (DateUtils.isFastDoubleClick()) {
            return;
        }

        Intent intent = ArticleDetailActivity.queryIntent(contextWeakReference.get());
        contextWeakReference.get().startActivity(intent);


    }
}

